var M10V_UI_ID = {
// ISP Option for Video
// Face Detection & Tracking(Enabled) COMBO is not used
// Face Detection & Tracking(Enabled) COMBO box
//    ComboBox_facedetection: {
//        sel_mode: "#FACE_DETECTION_TRACKING",
//        result : "#SNI_ComboRet"
//    },
// Video Image Stabilization(Enabled) COMBO box
    ComboBox_videoimage: {
        sel_mode: "#VIDEO_IMAGE_STABILIZATION",
        result : "#SNI_ComboRet"
    },
// Video HDR(Enabled) COMBO box
    ComboBox_videohdr: {
        sel_mode: "#VIDEO_HDR",
        result : "#SNI_ComboRet"
    },
// 3DNR(Enabled) COMBO box
    ComboBox_3dnr: {
        sel_mode: "#SEL_3DNR",
        result : "#SNI_ComboRet"
    },
// Backlight Compensation(Enabled) COMBO box
    ComboBox_backlight: {
        sel_mode: "#BACKLIGHT_COMPENSATION",
        result : "#SNI_ComboRet"
    },
// Defog(Enabled) COMBO box
    ComboBox_defog: {
        sel_mode: "#DEFOG",
        result : "#SNI_ComboRet"
    },
// Object Detection(Enabled) COMBO box
    ComboBox_object: {
        sel_mode: "#OBJECT_DETECTION",
        result : "#SNI_ComboRet"
    },
// Person Detection COMBO is not used
// Person Detection(Enabled) COMBO box
    ComboBox_person: {
        sel_mode: "#PERSON_DETECTION",
        result : "#SNI_ComboRet"
    },
// Tampering Alert(Enabled) COMBO box
    ComboBox_alert: {
        sel_mode: "#TAMPERING_ALERT",
        result : "#SNI_ComboRet"
    },
//Face Detection & Tracking(Enabled) Button is moved 11_fd.js
// Face Detection & Tracking(Enabled) Button
//    Button_facedetection: {
//        update: "#Btn_FACE_DETECTION_TRACKING",
//        result1: "#SNI_ButtonRet1"
//    },
// Video Image Stabilization(Enabled) Button
    Button_videoimage: {
        update: "#Btn_VIDEO_IMAGE_STABILIZATION",
        result1: "#SNI_ButtonRet1"
    },
// Video HDR(Enabled) Button
    Button_videohdr: {
        update: "#Btn_VIDEO_HDR",
        result1: "#SNI_ButtonRet1"
    },
// 3DNR(Enabled) Button
    Button_3dnr: {
        update: "#Btn_3DNR",
        result1: "#SNI_ButtonRet1"
    },
// BACKLIGHT_COMPENSATION(Enabled) Button
    Button_backlight: {
        update: "#Btn_BACKLIGHT_COMPENSATION",
        result1: "#SNI_ButtonRet1"
    },
// DEFOG(Enabled) Button
    Button_defog: {
        update: "#Btn_DEFOG",
        result1: "#SNI_ButtonRet1"
    },
//Person Detection Button is moved 12_pd.js
// PERSON_DETECTION(Enabled) Button
//    Button_person: {
//        update: "#Btn_PERSON_DETECTION",
//        result1: "#SNI_ButtonRet1"
//    },
// Face detection Configuration
// Face Detection Button
    Button_face_detect: {
        update: "#Btn_UPDATE_FACE_DET",
        result1: "#SNI_ButtonRet1"
    },

// Start FWUpdate
// FW Update Button
    Button_fw_update: {
        update: "#Btn_UPDATE_FW",
        result1: "#SNI_ButtonRet1"
    },
// FW Update address,size Text
    Text_FW: {
        fw_update_ad: "#TXT_FW_UPDATE_AD",
        fw_update_sz: "#TXT_FW_UPDATE_SZ"
    },



// SimpleTool
// SimpleTool Button
// Fix value.Not Cleate
//    ComboBox_st_update: {
//    },
//
// SimpleToo iq type COMBO box
    ComboBox_st_iq_type: {
        sel_mode: "#SEL_ST_IQ_TYPE",
        result : "#SNI_ComboRet"
    },
// SimpleToo iq id COMBO box
    ComboBox_st_iq_id: {
        sel_mode: "#SEL_ST_IQ_ID",
        result : "#SNI_ComboRet"
    },
// Crop Position COMBO box
    ComboBox_crop_pos: {
        sel_mode: "#CROP_POSITION",
        result : "#SNI_ComboRet"
    },

// Display Configuration
// Display COMBO box
    ComboBox_display: {
        sel_mode: "#SEL_DISPLAY",
        result : "#SNI_ComboRet"
    },
// Display Button
    Button_display: {
        update: "#Btn_DISPLAY",
        result1: "#SNI_ButtonRet1"
    },
    
// Storage Configuration
// Storage SD SAVE COMBO box
    ComboBox_sdsave: {
        sel_mode: "#SEL_SDSAVE",
        result : "#SNI_ComboRet"
    },
// Storage SD SAVE Button
    Button_sdsave: {
        update: "#Btn_SDSAVE",
        result1: "#SNI_ButtonRet1"
    },


// DOL Mode
// DOL Mode COMBO box
    ComboBox_changedolmode: {
        sel_mode: "#CHANGE_DOL_MODE",
        result : "#SNI_ComboRet"
    },
// DOL Mode Button
    Button_changedolmode: {
        update: "#Btn_DOL_MODE",
        result1: "#SNI_ButtonRet1"
    },



// SimpleTool SaveNAND Button
    Button_st_save_nand: {
        st_btn: "#Btn_SAVE_NAND",
        result1: "#SNI_ButtonRet1"
    },
// SimpleTool SaveSD Button
    Button_st_save_sd: {
        st_btn: "#Btn_SAVE_SD",
        result1: "#SNI_ButtonRet1"
    },
// SimpleTool ReadSD Button
    Button_st_read_sd: {
        st_btn: "#Btn_READ_SD",
        result1: "#SNI_ButtonRet1"
    },
// SimpleTool Start Button
    Button_st_start: {
        st_btn: "#Btn_START",
        result1: "#SNI_ButtonRet1"
    },
// SimpleTool Stop Button
    Button_st_stop: {
        st_btn: "#Btn_STOP",
        result1: "#SNI_ButtonRet1"
    }, 
// Face Detection width,height,coun Text
    Text: {
        face_w: "#TXT_FACE_W",
        face_h: "#TXT_FACE_H",
        face_cnt: "#TXT_FACE_COUNT"
    },
// Crop Stream
// Crop Stream Button
    Button_crop_stream: {
        st_btn: "#Btn_UPDATE_CROP_STREAM",
        result1: "#SNI_ButtonRet1"
    }, 
// CropStream X,Y Text
    Text_crop: {
        crop_stx: "#TXT_CROP_STREAM_X",
        crop_sty: "#TXT_CROP_STREAM_Y"
    },


// Stitch Configuration
// Center Offset Button
    Button_stitch_centeroffset: {
        st_btn: "#Btn_STITCH_OFFSET_PIXELS",
        result1: "#SNI_ButtonRet1"
    },
// Stitch Offset Pixels Text
    Text_stitch: {
        offset: "#TXT_STITCH_OFFSET_PIXELS"
    }
};


//Face Detection & Tracking(Enabled) Button is moved 11_fd.js
// Face Detection & Tracking(Enabled) Button
//$(M10V_UI_ID.Button_facedetection.update).click(function()
//{
//   var args = {
//        arg1: $(FACE_DETECTION_TRACKING).val()
//    };
//
//    $.ajax({
//        url: "/cgi-bin/webui/99_m10v/FaceDetection.cgi",
//        type: "POST",
//        dataType: "json",
//        contentType: "application/json",
//        data: JSON.stringify(args),
//        scriptCharset: "utf-8"
//    }).then(
//        function(data)
//        {
//           window.alert(" Face Detection ok\n");
//        },
//        function(data)
//        {
//           window.alert("NG"); 
//        }
//    );	
//	
//});
// Video Image Stabilization(Enabled) Button
$(M10V_UI_ID.Button_videoimage.update).click(function()
{
    var args = {
        arg1: $(VIDEO_IMAGE_STABILIZATION).val()
    };

    $.ajax({
        url: "/cgi-bin/webui/99_m10v/VideoImageStabilization.cgi",
        type: "POST",
        dataType: "json",
        contentType: "application/json",
        data: JSON.stringify(args),
        scriptCharset: "utf-8"
    }).then(
        function(data)
        {
           window.alert("Video Image Stabilization ok\n");
        },
        function(data)
        {
           window.alert("NG"); 
        }
    );	
	
});
// Video HDR(Enabled) Button
$(M10V_UI_ID.Button_videohdr.update).click(function()
{
    var args = {
        arg1: $(VIDEO_HDR).val()
    };

    $.ajax({
        url: "/cgi-bin/webui/99_m10v/videohdr.cgi",
        type: "POST",
        dataType: "json",
        contentType: "application/json",
        data: JSON.stringify(args),
        scriptCharset: "utf-8"
    }).then(
        function(data)
        {
           window.alert("VIDEO_HDR ok\n");
        },
        function(data)
        {
           window.alert("NG"); 
        }
    );	
	
});
// 3DNR(Enabled) Button
$(M10V_UI_ID.Button_3dnr.update).click(function()
{
    var args = {
        arg1: $(SEL_3DNR).val()
    };

    $.ajax({
        url: "/cgi-bin/webui/99_m10v/threednr.cgi",
        type: "POST",
        dataType: "json",
        contentType: "application/json",
        data: JSON.stringify(args),
        scriptCharset: "utf-8"
    }).then(
        function(data)
        {
           window.alert("3DNR ok\n");
        },
        function(data)
        {
           window.alert("NG"); 
        }
    );	
	
});
// Backlight Compensation(Enabled) Button
$(M10V_UI_ID.Button_backlight.update).click(function()
{
    var args = {
        arg1: $(BACKLIGHT_COMPENSATION).val()
    };

    $.ajax({
        url: "/cgi-bin/webui/99_m10v/backlight.cgi",
        type: "POST",
        dataType: "json",
        contentType: "application/json",
        data: JSON.stringify(args),
        scriptCharset: "utf-8"
    }).then(
        function(data)
        {
           window.alert("BACKLIGHT_COMPENSATION ok\n");
        },
        function(data)
        {
           window.alert("NG"); 
        }
    );	
	
});
// Defog(Enabled) Button
$(M10V_UI_ID.Button_defog.update).click(function()
{
    var args = {
        arg1: $(DEFOG).val()
    };

    $.ajax({
        url: "/cgi-bin/webui/99_m10v/defog.cgi",
        type: "POST",
        dataType: "json",
        contentType: "application/json",
        data: JSON.stringify(args),
        scriptCharset: "utf-8"
    }).then(
        function(data)
        {
           window.alert("Simple Defog ok\n");
        },
        function(data)
        {
           window.alert("NG"); 
        }
    );	
	
});

//Person Detection Button is moved 12_pd.js
// Person Detection(Enabled) Button
//$(M10V_UI_ID.Button_person.update).click(function()
//{
//    var args = {
//        arg1: $(PERSON_DETECTION).val()
//    };
//
//    $.ajax({
//        url: "/cgi-bin/webui/99_m10v/person.cgi",
//        type: "POST",
//        dataType: "json",
//        contentType: "application/json",
//        data: JSON.stringify(args),
//        scriptCharset: "utf-8"
//    }).then(
//        function(data)
//        {
//           window.alert("PERSON_DETECTION ok\n");
//        },
//        function(data)
//        {
//           window.alert("NG"); 
//        }
//    );	
//	
//});

// SimpleToo iq type COMBO box
$(M10V_UI_ID.ComboBox_st_iq_type.sel_mode).change(function()
{
    var args = {
        arg1: $(SEL_ST_IQ_TYPE).val(),
        arg2: $(SEL_ST_IQ_TYPE).val()
    };

    $.ajax({
        url: "/cgi-bin/webui/99_m10v/Getaddress.cgi",
        type: "POST",
        dataType: "json",
        contentType: "application/json",
        data: JSON.stringify(args),
        scriptCharset: "utf-8"
    }).then(
        function(data)
        {
           window.alert("iq type ok\n");
        },
        function(data)
        {
           window.alert("NG"); 
        }
    );	
	
});


// SimpleToo iq id COMBO box
$(M10V_UI_ID.ComboBox_st_iq_id.sel_mode).change(function()
{
    var args = {
        arg1: $(SEL_ST_IQ_TYPE).val(),
        arg2: $(SEL_ST_IQ_TYPE).val()
    };

    $.ajax({
        url: "/cgi-bin/webui/99_m10v/Getaddress.cgi",
        type: "POST",
        dataType: "json",
        contentType: "application/json",
        data: JSON.stringify(args),
        scriptCharset: "utf-8"
    }).then(
        function(data)
        {
           window.alert("iq id ok\n");
        },
        function(data)
        {
           window.alert("NG"); 
        }
    );	
	
});


// Crop Position COMBO box
$(M10V_UI_ID.ComboBox_crop_pos.sel_mode).change(function()
{
    var args = {
        arg1: $(SEL_ST_IQ_TYPE).val(),
        arg2: $(SEL_ST_IQ_TYPE).val()
    };

    $.ajax({
        url: "/cgi-bin/webui/99_m10v/SetCropStream.cgi",
        type: "POST",
        dataType: "json",
        contentType: "application/json",
        data: JSON.stringify(args),
        scriptCharset: "utf-8"
    }).then(
        function(data)
        {
           window.alert("iq id ok\n");
        },
        function(data)
        {
           window.alert("NG"); 
        }
    );	
	
});

// Display Button
$(M10V_UI_ID.Button_display.update).click(function()
{
    var args = {
        arg1: $(SEL_DISPLAY).val()
    };

    $.ajax({
        url: "/cgi-bin/webui/99_m10v/display.cgi",
        type: "POST",
        dataType: "json",
        contentType: "application/json",
        data: JSON.stringify(args),
        scriptCharset: "utf-8"
    }).then(
        function(data)
        {
           window.alert("Display ok\n");
        },
        function(data)
        {
           window.alert("NG"); 
        }
    );	
	
});
// Storage SD SAVE Button
$(M10V_UI_ID.Button_sdsave.update).click(function()
{
    var args = {
        arg1: $(SEL_SDSAVE).val()
    };

    $.ajax({
        url: "/cgi-bin/webui/99_m10v/sdsave.cgi",
        type: "POST",
        dataType: "json",
        contentType: "application/json",
        data: JSON.stringify(args),
        scriptCharset: "utf-8"
    }).then(
        function(data)
        {
           window.alert("SD save ok\n");
        },
        function(data)
        {
           window.alert("NG"); 
        }
    );	
	
});



// DOL Mode Button
$(M10V_UI_ID.Button_changedolmode.update).click(function()
{
    var args = {
        arg1: $(CHANGE_DOL_MODE).val()
    };

    $.ajax({
        url: "/cgi-bin/webui/99_m10v/Changedolmode.cgi",
        type: "POST",
        dataType: "json",
        contentType: "application/json",
        data: JSON.stringify(args),
        scriptCharset: "utf-8"
    }).then(
        function(data)
        {
           window.alert("DOL Modeok\n");
        },
        function(data)
        {
           window.alert("NG"); 
        }
    );	
	
});


                
// Face Detection Button
$(M10V_UI_ID.Button_face_detect.update).click(function()
{
    var args = {
        arg1: $(M10V_UI_ID.Text.face_w).val(),
        arg2: $(M10V_UI_ID.Text.face_h).val(),
        arg3: $(M10V_UI_ID.Text.face_cnt).val()
    };

    $.ajax({
        url: "/cgi-bin/webui/99_m10v/FacedetectConfig.cgi",
        type: "POST",
        dataType: "json",
        contentType: "application/json",
        data: JSON.stringify(args),
        scriptCharset: "utf-8"
    }).then(
        function(data)
        {
           window.alert("Face Detect Config ok\n");
        },
        function(data)
        {
           window.alert("NG"); 
        }
    );	
});

// FW Update Button
$(M10V_UI_ID.Button_fw_update.update).click(function()
{
    var args = {
        arg1: $(SEL_FW_UP_TYPE).val(),
        arg2: $(M10V_UI_ID.Text_FW.fw_update_ad).val(),
        arg3: $(M10V_UI_ID.Text_FW.fw_update_sz).val()
    };

    $.ajax({
        url: "/cgi-bin/webui/99_m10v/FWUpdate.cgi",
        type: "POST",
        dataType: "json",
        contentType: "application/json",
        data: JSON.stringify(args),
        scriptCharset: "utf-8"
    }).then(
        function(data)
        {
           window.alert("FW Update ok\n");
        },
        function(data)
        {
           window.alert("NG");
        }
    );
});


// SimlpeTool SaveNAND Button
$(M10V_UI_ID.Button_st_save_nand.st_btn).click(function()
{
// cameraIF is none param
    var param = {};

    $.ajax({
        url: "/cgi-bin/webui/99_m10v/SaveNAND.cgi",
        type: "POST",
        dataType: "json",
        contentType: "application/json",
        data: JSON.stringify(param),
        scriptCharset: "utf-8"
    }).then(
        function(data)
        {
           window.alert("Save NAND ok\n");
        },
        function(data)
        {
           window.alert("NG");
        }
    );
});


// SimlpeTool SaveSD Button
$(M10V_UI_ID.Button_st_save_sd.st_btn).click(function()
{
// cameraIF is none param
    var param = {};

    $.ajax({
        url: "/cgi-bin/webui/99_m10v/SaveSD.cgi",
        type: "POST",
        dataType: "json",
        contentType: "application/json",
        data: JSON.stringify(param),
        scriptCharset: "utf-8"
    }).then(
        function(data)
        {
           window.alert("Save SD ok\n");
        },
        function(data)
        {
           window.alert("NG");
        }
    );
});


// SimlpeTool ReadSD Button
$(M10V_UI_ID.Button_st_read_sd.st_btn).click(function()
{
// cameraIF is none param
    var param = {};

    $.ajax({
        url: "/cgi-bin/webui/99_m10v/ReadSD.cgi",
        type: "POST",
        dataType: "json",
        contentType: "application/json",
        data: JSON.stringify(param),
        scriptCharset: "utf-8"
    }).then(
        function(data)
        {
           window.alert("Read SD ok\n");
        },
        function(data)
        {
           window.alert("NG");
        }
    );
});


// SimlpeTool Start Button
$(M10V_UI_ID.Button_st_start.st_btn).click(function()
{
// cameraIF is none param
    var param = {};

    $.ajax({
        url: "/cgi-bin/webui/99_m10v/Start.cgi",
        type: "POST",
        dataType: "json",
        contentType: "application/json",
        data: JSON.stringify(param),
        scriptCharset: "utf-8"
    }).then(
        function(data)
        {
           window.alert("Start ok\n");
        },
        function(data)
        {
           window.alert("NG");
        }
    );
});

// SimlpeTool Stop Button
$(M10V_UI_ID.Button_st_stop.st_btn).click(function()
{
// cameraIF is none param
    var param = {};

    $.ajax({
        url: "/cgi-bin/webui/99_m10v/Stop.cgi",
        type: "POST",
        dataType: "json",
        contentType: "application/json",
        data: JSON.stringify(param),
        scriptCharset: "utf-8"
    }).then(
        function(data)
        {
           window.alert("Stop ok\n");
        },
        function(data)
        {
           window.alert("NG");
        }
    );
});


// Crop Stream Button
$(M10V_UI_ID.Button_crop_stream.st_btn).click(function()
{
    var args = {
        arg1: $(SEL_CROPSTREAM).val(),
        arg2: $(M10V_UI_ID.Text_crop.crop_stx).val(),
        arg3: $(M10V_UI_ID.Text_crop.crop_sty).val()
    };

    $.ajax({
        url: "/cgi-bin/webui/99_m10v/SetCropStream.cgi",
        type: "POST",
        dataType: "json",
        contentType: "application/json",
        data: JSON.stringify(args),
        scriptCharset: "utf-8"
    }).then(
        function(data)
        {
           window.alert("CropStream ok\n");
        },
        function(data)
        {
           window.alert("NG");
        }
    );
});


// Center Offset Button
$(M10V_UI_ID.Button_stitch_centeroffset.st_btn).click(function()
{
    var args = {
        arg1: $(M10V_UI_ID.Text_stitch.offset).val()
    };

    $.ajax({
        url: "/cgi-bin/webui/99_m10v/offsetpixels.cgi",
        type: "POST",
        dataType: "json",
        contentType: "application/json",
        data: JSON.stringify(args),
        scriptCharset: "utf-8"
    }).then(
        function(data)
        {
           window.alert("Center Offset ok\n");
        },
        function(data)
        {
           window.alert("NG");
        }
    );
});


